import React, { Component } from 'react'
export default class App extends Component {
  state={
    username:"",
    password:''
  }
  handleSubmit=(event)=>{
    event.preventDefault() 
    // console.log(this.username.value,this.password.value);
  }
  handleUsername=(event)=>{
    this.setState({username:event.target.value})
  }
  handlePassword=(event)=>{
    this.setState({password:event.target.value})
  }
  render() {
    return (
      <div>
        <form onSubmit={this.handleSubmit}>
          账户：<input onChange={this.handleUsername}/>
          密码：<input onChange={this.handlePassword}/>
          <button>提交</button>
        </form>
      </div>
    )
  }
}
